Miguel A. Cabrera Minagorri

2024-01-24

Computer vision at the edge with Nvidia Jetson in 2 commands

A few days ago I explained the benefits of using the Pipeless computer vision framework to develop and deploy your applications. Among other advantages, you get multi-stream processing and dynamic configuration out-of-the-box. This means you can add, edit and remove streams on the fly, without restarting your program, as well as specify how those streams should be processed at the time of adding the stream. In this post I will guide you through the list of commands that you need to deploy a Pipeless application to a Nvidia Jetson device. This example has been tested on a Nvidia Jetson Xavier, but it should work with other models too.

Walkthrough

First, install Pipeless on the Jetson device. Connect to the device via ssh and run the following command. Note iT will show some env vars at the end that you need to export:

curl https://raw.githubusercontent.com/pipeless-ai/pipeless/main/install.sh | bash

Then, the only other piece we need is to add our Pipeless stages. In this case, we will use the YOLOv8 example. You can learn more about Pipeless stages here, but in short, a stage is like a micro-pipeline. You can plug several stages one after the other dynamically when providing streams to Pipeless, so you can modify the processing behaviour per stream without changing your code and without restarting your application.

Let’s install some dependencies:

pip install opencv-python numpy ultralytics

Create the new project folder and download the YOLOv8 stage functions:

pipeless init my-project --template empty # Using the empty template we avoid the interactive shell
cd my-project
wget -O - https://github.com/pipeless-ai/pipeless/archive/main.tar.gz | tar -xz --strip=2 "pipeless-main/examples/yolo"

You can now start Pipeless:

pipeless start --stages-dir .

And provide a stream as follows:

pipeless add stream --input-uri "https://pipeless-public.s3.eu-west-3.amazonaws.com/cats.mp4" --output-uri "screen" --frame-path "yolo"

The above command assumes you have a display connected to the Jetson device to visualize the output stream. If you don’t have a display connected you can change the output URI to use a file or some multimedia server you may have.

And that’s all! Impressive, right?

You can find more examples in our documentation and learn how to create applications from scratch using Pipeless.

If you like the ease of creating and deploying computer vision applications with Pipeless don’t forget to star our GitHub repository

Subscribe to our newsletter!

Receive new tutorials, community highlights, release notes, and more!

Copyright © 2023 Pipeless, Inc.